package com.projekt.alpar;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

/**
 * "Keretosztály" a zenéket választó activitykhez
 */
public class ChooserActivity extends TabActivity {
	/**
	 * Létrehozza az activity-t, és betölti az egyes részactivityket
	 */
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.chooser);

		Resources res = getResources();
		TabHost tabHost = getTabHost();
		TabHost.TabSpec spec;
		Intent intent;

		intent = new Intent().setClass(this, ArtistsActivity.class);
		spec = tabHost
				.newTabSpec("artists")
				.setIndicator("Artists",
						res.getDrawable(R.drawable.ic_tab_artists))
				.setContent(intent);
		tabHost.addTab(spec);

		intent = new Intent().setClass(this, AlbumsActivity.class);
		spec = tabHost
				.newTabSpec("albums")
				.setIndicator("Albums",
						res.getDrawable(android.R.drawable.ic_btn_speak_now))
				.setContent(intent);
		tabHost.addTab(spec);

		intent = new Intent().setClass(this, PlaylistsActivity.class);
		spec = tabHost
				.newTabSpec("songs")
				.setIndicator("Songs",
						res.getDrawable(android.R.drawable.ic_delete))
				.setContent(intent);
		tabHost.addTab(spec);

		intent = new Intent().setClass(this, AllSongsActivity.class);
		spec = tabHost
				.newTabSpec("all")
				.setIndicator("All",
						res.getDrawable(android.R.drawable.ic_delete))
				.setContent(intent);
		tabHost.addTab(spec);

		tabHost.setCurrentTab(0);
	}
}
